Applications targeted at the creation or display of three-dimensional (3D) digital images (called “3D scenes” herein) typically employ some form of graphics database to store not only the 3D data that represents the geometry and appearance of objects in the 3D scene, but also structures that describe the hierarchical relationship and instances of the objects comprising the 3D scene. An example of this is a Computer-Aided Design (CAD) application that is used to draw and display an automotive assembly. The graphics database used by such an application may contain the data that represents a wheel of the automobile as well as a structure that is used by the application to determine how many times the wheel data is referenced and at which position in the scene it should be positioned. One type of graphics database is a scene graph.
A scene graph can be implemented as a tree structure, such as a directed acyclical graph. The scene graph contains specific information to accurately represent the 3D scene. First, the scene graph contains information that describes each unique geometric object contained in the scene. This is often a set of triangles, each triangle being composed of three vertices, with each vertex being represented by an x,y,z coordinate value. This value is typically a floating point data type because the content creation authoring tools regardless of market segment generate data in the floating point domain. The scene graph also contains information about the appearance of each geometric object when it is tendered. For example, the geometric object may be rendered as a filled or wireframe geometric object; the geometric object may rendered as being smooth or flat shaded; the geometric object may rendered as being lit or non-lit; or the geometric object may be rendered as having an image mapped onto it (e.g., texture mapped).
In addition to the data required to represent specific geometry and appearance of geometric objects corresponding to objects in the scene, the scene graph also contains information about the instantiation, relative size, position, and orientation of these geometric objects. Data for a single geometric object may be specified once but instantiated many times in different locations, sizes, and orientations. This is accomplished by one or more transform nodes in the scene graph. Transform nodes can store information such as x,y,z scale factor, x,y,z translation, and x,y,z angle of rotation. Each transform node in the scene graph can have one or more child nodes that can refer to information about the geometric object to be rendered or to specify additional transformations. Child nodes generally are other transform nodes or shape nodes. Transform nodes specify additional transformation and shape nodes specify appearance and geometric data. Shape nodes are usually leaf nodes in the scene graph, i.e., they have no children of their own. Whenever the scene graph is traversed by an application, a transform node is used to compute a transformation matrix, which is applied to geometric data specified by child nodes attached to the transform node to properly render the geometric objects represented by the child nodes in a drawing window on a display. Rendering includes positioning, sizing, orienting, and coloring the geometric objects.
Scene graphs, having a combination of geometric data, appearance attributes, transformations, and hierarchical relationships, are typically saved in file formats that an application can access to reconstruct or create a 3D scene. Furthermore, it is common for applications to provide various input and output filters to convert one file format into another file format so that 3D scenes can be shared between different applications.
While scene graphs and file formats having scene graphs allow 3D scenes to be created, stored, and tendered, there are certain problems while creating, storing and rendering 3D scenes. Thus, there is a need to fix these problems.